using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Main.controls
{
    public partial class ShowComment : System.Web.UI.UserControl
    {

        private int _commentID;
        private Comment _currentComment = new Comment();

        public int CommentID
        {
            get { return _commentID; }
            set { _commentID = value; }
        }
        public Comment CurrentComment
        {
            get { return _currentComment; }
            set { _currentComment = value; }
        }
        
        protected void Page_Load(object sender, EventArgs e)
        {
            CurrentComment.FillByID(CommentID);
            commenttext.Text = CurrentComment.Text;
            commentauthor.Text = Membership.GetUser((Guid)CurrentComment.UserID).UserName;
            commentdate.Text = CurrentComment.CreatedOn.ToShortDateString();
            commenttime.Text = CurrentComment.CreatedOn.ToShortTimeString();
            commenttitle.Text = CurrentComment.Title;
            profilelink.NavigateUrl = User.GetProfileURLforUsername(commentauthor.Text);
        }
    }
}